import { createRouter, createWebHashHistory } from "vue-router";

const routes = [
  {
    path: "/",
    name: "home",
    component: () => import("@/views/Home.vue"), //重定向
    meta: {
      title: "首页",
    },
  },
];
//配置
export const configRoutes = [
  {
    path: "/axios",
    name: "axios",
    meta: {
      title: "axios请求",
    },
    component: () => import("@/components/axios.vue"),
  },
  {
    path: "/vite",
    name: "vite",
    meta: {
      title: "vite",
    },
    component: () => import("@/components/vite.vue"),
  }, //配置
];
routes.push(...configRoutes);

const router = createRouter({
  history: createWebHashHistory(),
  routes: routes,
});
export default router;
